# Copyright 2010-2025 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")

package(default_visibility = ["//ortools/math_opt:__subpackages__"])

pybind_extension(
    name = "solver",
    srcs = ["solver.cc"],
    deps =
        select({
            "//ortools/linear_solver:use_cp_sat": ["//ortools/math_opt/solvers:cp_sat_solver"],
            "//conditions:default": [],
        }) +
        select({
            "//ortools/linear_solver:use_glop": ["//ortools/math_opt/solvers:glop_solver"],
            "//conditions:default": [],
        }) +
        select({
            "//ortools/linear_solver:use_glpk": ["//ortools/math_opt/solvers:glpk_solver"],
            "//conditions:default": [],
        }) +
        select({
            "//ortools/linear_solver:use_scip": ["//ortools/math_opt/solvers:gscip_solver"],
            "//conditions:default": [],
        }) +
        select({
            "//ortools/linear_solver:use_pdlp": ["//ortools/math_opt/solvers:pdlp_solver"],
            "//conditions:default": [],
        }) + [
            "//ortools/base:status_macros",
            "//ortools/math_opt:callback_cc_proto",
            "//ortools/math_opt:infeasible_subsystem_cc_proto",
            "//ortools/math_opt:model_cc_proto",
            "//ortools/math_opt:model_parameters_cc_proto",
            "//ortools/math_opt:model_update_cc_proto",
            "//ortools/math_opt:parameters_cc_proto",
            "//ortools/math_opt:result_cc_proto",
            "//ortools/math_opt/core:solver",
            "//ortools/math_opt/core:solver_debug",
            "//ortools/util:solve_interrupter",
            "@com_google_absl//absl/memory",
            "@com_google_absl//absl/status:statusor",
            "@pybind11_abseil//pybind11_abseil:import_status_module",
            "@pybind11_abseil//pybind11_abseil:status_casters",
            "@pybind11_protobuf//pybind11_protobuf:native_proto_caster",
        ],
)
